// 封装旅游管理相关接口
import request from '@/utils/request'

// 获取省份和城市数据
export const getProvinceCityService = () => {
  return request({
    url: '/region',
    method: 'GET'
  })
}

// 景点
// 获取景点列表信息
export const getSceneryListService = ({ pageSize, page }) => {
  return request({
    url: '/api/scenery/list',
    method: 'GET',
    params: {
      pageSize: pageSize,
      page: page
    }
  })
}

// 景点热门状态切换
export const ToggleHotSceneryService = (id) => {
  return request({
    url: `/api/scenery/hot/toggle/${id}`,
    method: 'PATCH'
  })
}

// 景点列表搜索功能实现
export const searchSceneryService = (data) => {
  return request({
    url: '/api/scenery/search',
    method: 'GET',
    params: {
      data
    }
  })
}

// 删除景点
export const deleteSceneryService = (id) => {
  return request({
    url: `/api/scenery/del/${id}`,
    method: 'DELETE'
  })
}

// 获取景点详情
export const getSceneryDetailService = (id) => {
  return request({
    url: `/scenery/detail/${id}`,
    method: 'GET'
  })
}

// 发布景点
export const publishSceneryService = (data) => {
  return request({
    url: '/api/scenery/publish',
    method: 'POST',
    data
  })
}

// 酒店
// 获取酒店列表信息
export const getHotelListService = ({ pageSize, page }) => {
  return request({
    url: '/api/hotel/list',
    method: 'GET',
    params: {
      pageSize: pageSize,
      page: page
    }
  })
}

// 酒店热门状态切换
export const ToggleHotHotelService = (id) => {
  return request({
    url: `/api/hotel/hot/toggle/${id}`,
    method: 'PATCH'
  })
}

// 酒店列表搜索功能实现
export const searchHotelService = (data) => {
  return request({
    url: '/api/hotel/search',
    method: 'GET',
    params: {
      data
    }
  })
}

// 删除酒店
export const deleteHotelService = (id) => {
  return request({
    url: `/api/hotel/del/${id}`,
    method: 'DELETE'
  })
}

// 获取酒店详情
export const getHotelDetailService = (id) => {
  return request({
    url: `/hotel/detail/${id}`,
    method: 'GET'
  })
}

// 发布酒店
export const publishHotelService = (data) => {
  return request({
    url: '/api/hotel/publish',
    method: 'POST',
    data
  })
}

// 餐厅
// 获取餐厅列表信息
export const getRestaurantListService = ({ pageSize, page }) => {
  return request({
    url: '/api/restaurant/list',
    method: 'GET',
    params: {
      pageSize: pageSize,
      page: page
    }
  })
}

// 餐厅热门状态切换
export const ToggleHotRestaurantService = (id) => {
  return request({
    url: `/api/restaurant/hot/toggle/${id}`,
    method: 'PATCH'
  })
}

// 餐厅列表搜索功能实现
export const searchRestaurantService = (data) => {
  return request({
    url: '/api/restaurant/search',
    method: 'GET',
    params: {
      data
    }
  })
}

// 删除餐厅
export const deleteRestaurantService = (id) => {
  return request({
    url: `/api/restaurant/del/${id}`,
    method: 'DELETE'
  })
}

// 获取餐厅详情
export const getRestaurantDetailService = (id) => {
  return request({
    url: `/restaurant/detail/${id}`,
    method: 'GET'
  })
}

// 发布餐厅
export const publishRestaurantService = (data) => {
  return request({
    url: '/api/restaurant/publish',
    method: 'POST',
    data
  })
}
